<template>
    <div class="avatar-uploader">
        <input type="file" name="" id="" @change="handleChange">
    </div>
</template>

<script>
// import { Plus } from "@element-plus/icons-vue";
import request from "@/utils/request";

export default {
    methods: {
        handleChange(event) {
            console.log('event', event);
            // 文件对象
            const files = event.target.files;
            const file = [files[0]];

            const fd = new FormData();


            request.post("/app/base/comm/upload", fd,
                {
                    // 默认值时:applicationxxx
                    headers: {
                        "Content-Type": "multipart/form-data"
                    }
                }).then(data => {
                    console.log(data)
                })
        }
    },

}
</script>